<!DOCTYPE html>
<html>
<head>
	<title>drawFilledCircleWithMouse</title>
</head>
<body>
	<canvas id="canvas" width="400" height="400"></canvas><!--画布要定义大小，默认很小-->
	<script src="http://code.jquery.com/jquery-2.1.0.js"></script>
	<script type="text/javascript">
	var canvas = document.getElementById("canvas");
	var ctx = canvas.getContext("2d");
	ctx.fillStyle="Purple";
    var moveHandler = function(event){
    	var x = event.pageX;
    	var y = event.pageY;
    	ctx.beginPath();
    	ctx.arc(x,y,3,Math.PI*2,false);
    	ctx.fill();//要加这句才会画！
    }
    $("#canvas").mousemove(moveHandler);
	</script>
</body>
</html>